# 测试环境配置
import os

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

# 数据库配置
HOSTNAME = 'localhost'
PORT = 3306
USERNAME = 'root'
PASSWORD = '123456'
DATABASE = 'sandaogou'
DB_URI = f"mysql+pymysql://{USERNAME}:{PASSWORD}@{HOSTNAME}:{PORT}/{DATABASE}"
SQLALCHEMY_DATABASE_URI = DB_URI

# 主服务器
neo4j_uri = 'bolt://localhost:7687'
neo4j_username = 'neo4j'
neo4j_password = 'buct@601'
# 从服务器
neo4j_synchronize = 'bolt://localhost:7687'
neo4j_username_synchronize = 'neo4j'
neo4j_password_synchronize = 'buct@601'

# 日志目录
LOG_DIR = os.getenv('LOG_DIR', os.path.join(BASE_DIR, 'logs'))

# UIE地址
UIE_ADDR = os.getenv('LOG_DIR', os.path.join(BASE_DIR, 'params', 'UIE'))

# LLM模型
# LLM_MODEL = os.getenv('LOG_DIR', os.path.join(BASE_DIR, 'params', 'chatglm3-6b'))
# LLM_MODEL = os.getenv('LOG_DIR', os.path.join(BASE_DIR, 'params', 'Qwen1.5-1.8B-Chat'))
LLM_MODEL = os.getenv('LOG_DIR', os.path.join(BASE_DIR, 'params', 'Qwen1.5-0.5B-Chat'))
# LLM_MODEL = os.getenv('LOG_DIR', os.path.join(BASE_DIR, 'params', 'Qwen1.5-0.5B-Chat-GPTQ-Int4'))
# Embedding 模型
EMBEDDING_MODEL = os.getenv('LOG_DIR', os.path.join(BASE_DIR, 'params', 'bge-small-zh-v1.5'))
# 存放知识库的Root path
MODEL_DIR = os.getenv('LOG_DIR', os.path.join(BASE_DIR, 'knowledge_base'))
# 句子划分长度
sentence_size = 200
# device cuda or cpu
DEVICE_IN = "cuda"
# DEVICE_IN = "cpu"
SCORE_THRESHOLD = 0.7
TEMPERATURE = 0.7
TOP_K = 3

# 使用的向量库 faiss Milvus
KB_TYPE = "Milvus"

# Milvus向量数据库配置 主向量库
KB_HOST = "localhost"
KB_PORT = "19530"
KB_NAME = "sandaogou"

# 从向量库
KB_HOST_synchronize = "localhost"
KB_PORT_synchronize = "19530"
KB_NAME_synchronize = "sandaogou"


#predict_web
DEBUG = True
TESTING = False
SQLALCHEMY_TRACK_MODIFICATIONS = False
MODEL_PATH = 'model.pth'# 可选：模型路径等
MONITORING_START_TIME = None